<?php  
include_once('../bootstrap.php');
$cooperativas = Cooperativa::findAll();
$result = array();
foreach ($cooperativas as $cooperativa) {
    $c = array ();
    $c['id'] = $cooperativa->id;
    $c['info'] = utf8_encode($cooperativa->direccion);
    $c['nombre'] = utf8_encode($cooperativa->nombre);
    $c['nombreUrl'] = utf8_encode($cooperativa->nombreUrl);
    $c['polygon'] = utf8_encode($cooperativa->polygon);
    $c['centro'] = utf8_encode($cooperativa->centro);
    $result[] = $c;
}
header("Content-type: application/json");
echo(json_encode($result));
?>